import { RECORD_STATUS } from '@/enum/common';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';

@Entity('invitation_code')
export class InvitationCode extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'user_id',
    comment: '发布人id',
  })
  userId: number;

  @Column({
    type: 'varchar',
    name: 'code',
    comment: '邀请码',
  })
  code: string;

  @Column({
    type: 'int',
    name: 'status',
    comment: '状态',
    default: RECORD_STATUS.SHOW,
  })
  status: RECORD_STATUS;
}
